home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Applications 1996 May / SGI IRIX 6.2 Applications 1996 May.iso / dist / patchSG0001239.idb / usr / lib / SoftWindows2 / bin / scripts / view_hints.sh.z / view_hints.sh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-05-07  |  1.6 KB  |  63 lines

  1. #!/bin/sh
  2. #                       SCF - SwinConFiguration filename
  3. #                       SAV- name of Saved file.
  4. #                       SYS- name of System wide configuration defaults file.
  5. PATH=/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/usr/bin/X11
  6. export PATH
  7. SCF=$HOME/.swin2config
  8. SAV=$SCF.pre2.00
  9. SYS=$SWIN2HOME/sys.swin2config
  10. HINTS=$SWIN2HOME/swin_hints 
  11. HINTS_HTML=$SWIN2HOME/swin_hints.html
  12. VIEWED=$SWIN2HOME/swin_hints_viewed
  13. FGREP=/usr/bin/fgrep
  14. GREP=/sbin/grep
  15. UNAME=/sbin/uname
  16. XCONFIRM=/usr/bin/X11/xconfirm
  17. CAT=/sbin/cat
  18. CPIO=/sbin/cpio
  19. AWK=/usr/bin/awk
  20. FIND=/sbin/find
  21. SED=/sbin/sed
  22. PS=/sbin/ps
  23. SLEEP=/sbin/sleep
  24. NETSCAPE=/usr/bin/X11/netscape
  25. CSH=/sbin/csh
  26.  
  27. # The following displays swin_hints if they haven't been seen
  28. # by this user before, or if the sysadmin clears the user's
  29. # name from the $VIEWED file (because the hints have changed).
  30.  
  31. # Note that if licensing needs to be done, the hints come up
  32. # on top of the licensing window.  Not on top of the DOS or
  33. # MS-windows window.
  34.  
  35. if $FGREP -s $USER $VIEWED ; then
  36.     exit 0;
  37. fi
  38.  
  39. $CSH -f $SWIN2HOME/bin/scripts/user_env.sw
  40.  
  41. ( if [ -r $HINTS ] ; then
  42.     WAIT=5
  43.     while [ $WAIT -gt 0 ]
  44.     do
  45.         $SLEEP 2
  46.         PROC=`$PS -e | $AWK '{ print $4 }' | $GREP swin | $GREP -v grep`
  47.         if [ "$PROC" = "" ] ; then
  48.             WAIT=`expr $WAIT - 1`
  49.         else
  50.             WAIT=0
  51.         fi
  52.     done
  53.     $SLEEP 5
  54.     if [ -r $HINTS_HTML -a -x $NETSCAPE ] ; then
  55.             $NETSCAPE $HINTS_HTML & 
  56.     else
  57.         dd=`$XCONFIRM -c -B Ok -file $HINTS \
  58.              -header "SoftWindows Usage Hints" -useslider &`
  59.     fi
  60.     echo $USER >>$VIEWED
  61. fi ) &
  62. exit 0;
  63.